from rest_framework import serializers
from users.models import User


class UserInfoSerializer(serializers.ModelSerializer):
    """用户管理序列化器"""
    class Meta:
        model = User
        fields = ('id', 'username', 'nickname', 'email', 'user_pic')
        extra_kwargs = {
            'nickname': {'min_length': 1, 'max_length': 6}
        }
